home *** CD-ROM | disk | FTP | other *** search
- unit Rootform;
- (*--------------------------------------------------------------------*)
- (* MAMAVISION Software Consult *)
- (*--------------------------------------------------------------------*)
- (* 'Root' Formclass which covers functionality for all derived *)
- (* 'Data' Forms. *)
- (* When IDE supports form inheritance the method LoadRes will *)
- (* be cleared and the file rootform.dfm must no longer be provided*)
- (*--------------------------------------------------------------------*)
- (* Subclassing: *)
- (* TForm --> TForm0 *)
- (**********************************************************************)
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, Buttons, ExtCtrls;
-
- type
- TForm0 = class(TForm)
- StatusBar: TPanel;
- SpeedPanel: TPanel;
- OpenBtn: TSpeedButton;
- SaveBtn: TSpeedButton;
- ExitBtn: TSpeedButton;
- NextBtn: TSpeedButton;
- procedure ExitBtnClick(Sender: TObject);
- procedure NextBtnClick(Sender: TObject);
- private
- { Private-Deklarationen }
- protected
- { Protected-Deklarationen }
- ResLoaded:boolean;
- procedure LoadRes;
- public
- { Public-Deklarationen }
- end;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm0.LoadRes;
- var tempCaption:string;
- component_dummy:tcomponent;
- begin
- if Resloaded then exit;
- tempCaption := caption; { Save Props of derived Form }
- try { at runtime : read from current dir or custom path...}
- component_dummy := ReadComponentResFile('RootForm.dfm', Self);
- except { debugging : read from special dir }
- component_dummy := ReadComponentResFile('e:\RootForm.dfm', Self);
- end;
- Caption := tempCaption; { Restore Props of derived Form }
- Resloaded := component_dummy <> nil;
- end;
-
- procedure TForm0.ExitBtnClick(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TForm0.NextBtnClick(Sender: TObject);
- begin
- messagebeep(10);
- end;
-
- end.
-